Optimal. Leaf size=86 \[ \frac{1}{2} a x \left (a^2+3 b^2\right )-\frac{a b^2 \tan (c+d x)}{2 d}-\frac{\cos ^2(c+d x) (b-a \tan (c+d x)) (a+b \tan (c+d x))^2}{2 d}-\frac{b^3 \log (\cos (c+d x))}{d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0932581, antiderivative size = 86, normalized size of antiderivative = 1., number of steps used = 6, number of rules used = 6, integrand size = 21, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.286, Rules used = {3506, 739, 774, 635, 203, 260} \[ \frac{1}{2} a x \left (a^2+3 b^2\right )-\frac{a b^2 \tan (c+d x)}{2 d}-\frac{\cos ^2(c+d x) (b-a \tan (c+d x)) (a+b \tan (c+d x))^2}{2 d}-\frac{b^3 \log (\cos (c+d x))}{d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3506
Rule 739
Rule 774
Rule 635
Rule 203
Rule 260
Rubi steps
\begin{align*} \int \cos ^2(c+d x) (a+b \tan (c+d x))^3 \, dx &=\frac{\operatorname{Subst}\left (\int \frac{(a+x)^3}{\left (1+\frac{x^2}{b^2}\right )^2} \, dx,x,b \tan (c+d x)\right )}{b d}\\ &=-\frac{\cos ^2(c+d x) (b-a \tan (c+d x)) (a+b \tan (c+d x))^2}{2 d}+\frac{b \operatorname{Subst}\left (\int \frac{(a+x) \left (2+\frac{a^2}{b^2}-\frac{a x}{b^2}\right )}{1+\frac{x^2}{b^2}} \, dx,x,b \tan (c+d x)\right )}{2 d}\\ &=-\frac{a b^2 \tan (c+d x)}{2 d}-\frac{\cos ^2(c+d x) (b-a \tan (c+d x)) (a+b \tan (c+d x))^2}{2 d}+\frac{b^3 \operatorname{Subst}\left (\int \frac{\frac{a}{b^2}+\frac{a \left (2+\frac{a^2}{b^2}\right )}{b^2}+\frac{2 x}{b^2}}{1+\frac{x^2}{b^2}} \, dx,x,b \tan (c+d x)\right )}{2 d}\\ &=-\frac{a b^2 \tan (c+d x)}{2 d}-\frac{\cos ^2(c+d x) (b-a \tan (c+d x)) (a+b \tan (c+d x))^2}{2 d}+\frac{b \operatorname{Subst}\left (\int \frac{x}{1+\frac{x^2}{b^2}} \, dx,x,b \tan (c+d x)\right )}{d}+\frac{\left (a \left (a^2+3 b^2\right )\right ) \operatorname{Subst}\left (\int \frac{1}{1+\frac{x^2}{b^2}} \, dx,x,b \tan (c+d x)\right )}{2 b d}\\ &=\frac{1}{2} a \left (a^2+3 b^2\right ) x-\frac{b^3 \log (\cos (c+d x))}{d}-\frac{a b^2 \tan (c+d x)}{2 d}-\frac{\cos ^2(c+d x) (b-a \tan (c+d x)) (a+b \tan (c+d x))^2}{2 d}\\ \end{align*}
Mathematica [B] time = 0.746237, size = 401, normalized size = 4.66 \[ \frac{a b \left (-2 a^2 b^2+a^4-3 b^4\right ) \sin (2 (c+d x))+\left (-2 a^2 b^4-3 a^4 b^2+b^6\right ) \cos (2 (c+d x))+2 a^2 b^4 \log \left (\sqrt{-b^2}-b \tan (c+d x)\right )+2 a^2 b^4 \log \left (\sqrt{-b^2}+b \tan (c+d x)\right )+4 a^3 \left (-b^2\right )^{3/2} \log \left (\sqrt{-b^2}-b \tan (c+d x)\right )-a^5 \sqrt{-b^2} \log \left (\sqrt{-b^2}-b \tan (c+d x)\right )-4 a^3 \left (-b^2\right )^{3/2} \log \left (\sqrt{-b^2}+b \tan (c+d x)\right )+a^5 \sqrt{-b^2} \log \left (\sqrt{-b^2}+b \tan (c+d x)\right )+2 a^2 b^4+5 a^4 b^2+3 a \sqrt{-b^2} b^4 \log \left (\sqrt{-b^2}+b \tan (c+d x)\right )-3 a \left (-b^2\right )^{5/2} \log \left (\sqrt{-b^2}-b \tan (c+d x)\right )+2 b^6 \log \left (\sqrt{-b^2}-b \tan (c+d x)\right )+2 b^6 \log \left (\sqrt{-b^2}+b \tan (c+d x)\right )-b^6}{4 b d \left (a^2+b^2\right )} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.059, size = 123, normalized size = 1.4 \begin{align*} -{\frac{ \left ( \sin \left ( dx+c \right ) \right ) ^{2}{b}^{3}}{2\,d}}-{\frac{{b}^{3}\ln \left ( \cos \left ( dx+c \right ) \right ) }{d}}-{\frac{3\,\cos \left ( dx+c \right ) \sin \left ( dx+c \right ) a{b}^{2}}{2\,d}}+{\frac{3\,a{b}^{2}x}{2}}+{\frac{3\,a{b}^{2}c}{2\,d}}-{\frac{3\,{a}^{2} \left ( \cos \left ( dx+c \right ) \right ) ^{2}b}{2\,d}}+{\frac{{a}^{3}\sin \left ( dx+c \right ) \cos \left ( dx+c \right ) }{2\,d}}+{\frac{{a}^{3}x}{2}}+{\frac{{a}^{3}c}{2\,d}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.73724, size = 109, normalized size = 1.27 \begin{align*} \frac{b^{3} \log \left (\tan \left (d x + c\right )^{2} + 1\right ) +{\left (a^{3} + 3 \, a b^{2}\right )}{\left (d x + c\right )} - \frac{3 \, a^{2} b - b^{3} -{\left (a^{3} - 3 \, a b^{2}\right )} \tan \left (d x + c\right )}{\tan \left (d x + c\right )^{2} + 1}}{2 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.98182, size = 181, normalized size = 2.1 \begin{align*} -\frac{2 \, b^{3} \log \left (-\cos \left (d x + c\right )\right ) -{\left (a^{3} + 3 \, a b^{2}\right )} d x +{\left (3 \, a^{2} b - b^{3}\right )} \cos \left (d x + c\right )^{2} -{\left (a^{3} - 3 \, a b^{2}\right )} \cos \left (d x + c\right ) \sin \left (d x + c\right )}{2 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \left (a + b \tan{\left (c + d x \right )}\right )^{3} \cos ^{2}{\left (c + d x \right )}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] time = 1.91175, size = 811, normalized size = 9.43 \begin{align*} \text{result too large to display} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]